<?php
/**
 * Created by PhpStorm.
 * User: 68008000
 * Date: 2017/11/16
 * Time: 11:13
 */

namespace app\index\controller;


use think\Controller;

class Common extends Controller
{
    public function __construct()
    {
        parent::__construct();
        //分类
        $nav=db('category')->where('pid',0)->limit(3)->select();
        $this->assign('nav',$nav);
        //标签
        $lists=db('tag')->select();
        $this->assign('lists',$lists);
        //分类
        $cateData=db('category')->select();
        $this->assign('cateData',$cateData);
        //
        $article=db('article')->where('is_recycle',1)->order('sendtime desc')->limit(2)->field(['aid,title,sendtime'])->select();
        $this->assign('article',$article);

        $link=db('link')->order('addtime desc')->limit(3)->field(['lname,logo,url '])->select();
        $this->assign('link',$link);

    }
}